package com.axend.aerosense.common;


import java.net.URI;

//webSocket接口
public class WsApi {

//    private static String BASE_URL = "ws://10.8.4.131:8080/app_ws/"; //测试服
    private static String BASE_URL = "ws://10.8.0.10:8080/"; //测试服

//    private static String BASE_URL = "wss://aerosense.ax-end.com:8803/app_ws/"; //正式服

    public static String getBaseUrl() {
        return BASE_URL;
    }

    public static void setBaseUrl(String url){
        BASE_URL = url;
    }

    enum URL {
        //1. 雷达门口学习
        PositionStudy("position/study"),
        //2. 雷达 呼吸-心率 值同步 接口
        RespiratoryHeartRateSync("respiratoryHeartRate/sync"),
        ;

        private final String url;

        URL(String tmp) {
            url = tmp;
        }

        public String getUrl() {
            return BASE_URL + url;
        }
    }

    public static URI getPositionStudyURI(String token,String radarId){
        return URI.create(URL.PositionStudy.getUrl()+"?token="+token+"&radarId="+radarId);
    }
    public static URI getRespiratoryHeartRateSyncURI(String token,String radarId){
        return URI.create(URL.RespiratoryHeartRateSync.getUrl()+"?token="+token+"&radarId="+radarId);
    }
}
